import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Blogs from '../views/Blogs.vue'
import BlogDetail from "@/views/BlogDetail";
import BlogEdit from "@/views/BlogEdit";
import AllSubject from "@/views/AllSubject";
import AllBlogs from "@/views/AllBlogs";
import Class from "@/views/Class";
import Blog from "@/views/Blog";
import Collection from "@/views/Collection";
import DashBoard from "@/views/DashBoard";
import Follow from "@/views/Follow";
import NewBlog from "@/views/NewBlog";
import NewClass from "@/views/NewClass";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    redirect:{ name:"Login"}
  },

  {
    path: '/blogs',
    name: 'Blogs',
    component: Blogs
  },




  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  //全部专题页面
  {
    path: '/AllSubject',
    name: 'AllSubject',
    component: AllSubject
  },
  //  个人中心页面
  {
    path: '/Blog',
    name: 'Blog',
    component: Blog
  },
  // 专题列表
  {
    path: '/Class',
    name: 'Class',
    component: Class
  },
  {
    path: '/dashboard',
    name: 'DashBoard',
    component: DashBoard,
  },

  {
    path: '/collection',
    name: 'Collection',
    component: Collection,
  },

  {
    path: '/follow',
    name: 'Follow',
    component: Follow,
  },
  {
    path: '/newblog',
    name: 'NewBlog',
    component: NewBlog,
  },

  {
    path: '/newclass',
    name: 'NewClass',
    component: NewClass,
  },











  //  全部博客页面
  {
    path: '/AllBlogs',
    name: 'AllBlogs',
    component: AllBlogs
  },
  //注意add和detail的顺序
  {
    path: '/blog/add',
    name: 'BlogEdit',
    component: BlogEdit
  },

  {
    path: '/blog/1/',
    name: 'BlogDetail',
    component: BlogDetail
  },

  {
    path: '/blog/:blogId/edit',
    name: 'BlogEdit',
    component: BlogEdit
  },

]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
